class Solution {
public:
    vector<int> twoSum(vector<int>& nums, int target) {
        map<int, int>mymap;
        for(int i = 0; i<nums.size(); i++){
            auto fx = mymap.find(target-nums[i]);
            if(fx == mymap.end()){
                mymap[nums[i]]=i;
            }else{
                return {fx->second,i};
            }
        }
        return {};
    }
};
